<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Mail extends CI_Controller {

	public function index(){
	if($this->session->userdata('logged_in')){
		$this->load->view('mail');
	} else {
			$this->load->view('login');
		}
	}

	public function send_mail(){
		$mail    = $this->input->post('email');
		$subject = $this->input->post('subject');
		$content = $this->input->post('content');
		$this->load->library('mailer');
		$this->mailer->sendmail($mail, $subject, $content);
		echo '{"err_no" : 0}';
	}
}

